package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;


import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the orderform database table.
 * 
 */
@Entity
@NamedQuery(name="Orderform.findAll", query="SELECT o FROM Orderform o")
public class Orderform implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="o_id")
	private int oId;

	@Temporal(TemporalType.DATE)
	@Column(name="o_date")
	private Date oDate;

	@Temporal(TemporalType.DATE)
	@Column(name="o_latedate")
	private Date oLatedate;

	@Column(name="o_show")
	private int oShow;

	@Column(name="o_sumcount")
	private int oSumcount;

	@Column(name="o_summoney")
	private BigDecimal oSummoney;

	private String otitle;

	//bi-directional many-to-one association to Deliveryschedule
	@OneToMany(mappedBy="orderform")
	private List<Deliveryschedule> deliveryschedules;

	//bi-directional one-to-one association to Orderdetail
	@OneToOne(mappedBy="orderform")
	private Orderdetail orderdetail;

	//bi-directional many-to-one association to Addresdetail
	@ManyToOne
	@JoinColumn(name="ad_id")
	private Addresdetail addresdetail;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cus_id")
	private Customer customer;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="o_classify")
	private Dictionary dictionary1;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="o_payment")
	private Dictionary dictionary2;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="o_state")
	private Dictionary dictionary3;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="o_way")
	private Dictionary dictionary4;

	//bi-directional many-to-one association to Linkman
	@ManyToOne
	@JoinColumn(name="lin_id")
	private Linkman linkman;

	//bi-directional many-to-one association to Opportunity
	@ManyToOne
	@JoinColumn(name="opp_id")
	private Opportunity opportunity;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="use_id")
	private User user;

	//bi-directional many-to-one association to Orderlog
	@OneToMany(mappedBy="orderform")
	private List<Orderlog> orderlogs;

	//bi-directional many-to-one association to Returne
	@OneToMany(mappedBy="orderform")
	private List<Returne> returnes;
	

	//bi-directional many-to-one association to Moneybackplan
	@OneToMany(mappedBy="orderform")
	private List<Moneybackplan> moneybackplans1;
	

	//bi-directional many-to-one association to Returnmore
	@OneToMany(mappedBy="orderform")
	private List<Returnmore> returnmores;

	public Orderform() {
	}

	public int getOId() {
		return this.oId;
	}

	public void setOId(int oId) {
		this.oId = oId;
	}

	public Date getODate() {
		return this.oDate;
	}

	public void setODate(Date oDate) {
		this.oDate = oDate;
	}

	public Date getOLatedate() {
		return this.oLatedate;
	}

	public void setOLatedate(Date oLatedate) {
		this.oLatedate = oLatedate;
	}

	public int getOShow() {
		return this.oShow;
	}

	public void setOShow(int oShow) {
		this.oShow = oShow;
	}

	public int getOSumcount() {
		return this.oSumcount;
	}

	public void setOSumcount(int oSumcount) {
		this.oSumcount = oSumcount;
	}

	public BigDecimal getOSummoney() {
		return this.oSummoney;
	}

	public void setOSummoney(BigDecimal oSummoney) {
		this.oSummoney = oSummoney;
	}

	public String getOtitle() {
		return this.otitle;
	}

	public void setOtitle(String otitle) {
		this.otitle = otitle;
	}

	public List<Deliveryschedule> getDeliveryschedules() {
		return this.deliveryschedules;
	}

	public void setDeliveryschedules(List<Deliveryschedule> deliveryschedules) {
		this.deliveryschedules = deliveryschedules;
	}

	public Deliveryschedule addDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().add(deliveryschedule);
		deliveryschedule.setOrderform(this);

		return deliveryschedule;
	}

	public Deliveryschedule removeDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().remove(deliveryschedule);
		deliveryschedule.setOrderform(null);

		return deliveryschedule;
	}

	public Orderdetail getOrderdetail() {
		return this.orderdetail;
	}

	public void setOrderdetail(Orderdetail orderdetail) {
		this.orderdetail = orderdetail;
	}

	public Addresdetail getAddresdetail() {
		return this.addresdetail;
	}

	public void setAddresdetail(Addresdetail addresdetail) {
		this.addresdetail = addresdetail;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Dictionary getDictionary1() {
		return this.dictionary1;
	}

	public void setDictionary1(Dictionary dictionary1) {
		this.dictionary1 = dictionary1;
	}

	public Dictionary getDictionary2() {
		return this.dictionary2;
	}

	public void setDictionary2(Dictionary dictionary2) {
		this.dictionary2 = dictionary2;
	}

	public Dictionary getDictionary3() {
		return this.dictionary3;
	}

	public void setDictionary3(Dictionary dictionary3) {
		this.dictionary3 = dictionary3;
	}

	public Dictionary getDictionary4() {
		return this.dictionary4;
	}

	public void setDictionary4(Dictionary dictionary4) {
		this.dictionary4 = dictionary4;
	}

	public Linkman getLinkman() {
		return this.linkman;
	}

	public void setLinkman(Linkman linkman) {
		this.linkman = linkman;
	}

	public Opportunity getOpportunity() {
		return this.opportunity;
	}

	public void setOpportunity(Opportunity opportunity) {
		this.opportunity = opportunity;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Orderlog> getOrderlogs() {
		return this.orderlogs;
	}

	public void setOrderlogs(List<Orderlog> orderlogs) {
		this.orderlogs = orderlogs;
	}

	public Orderlog addOrderlog(Orderlog orderlog) {
		getOrderlogs().add(orderlog);
		orderlog.setOrderform(this);

		return orderlog;
	}

	public Orderlog removeOrderlog(Orderlog orderlog) {
		getOrderlogs().remove(orderlog);
		orderlog.setOrderform(null);

		return orderlog;
	}

	public List<Returne> getReturnes() {
		return this.returnes;
	}

	public void setReturnes(List<Returne> returnes) {
		this.returnes = returnes;
	}

	public Returne addReturne(Returne returne) {
		getReturnes().add(returne);
		returne.setOrderform(this);

		return returne;
	}

	public Returne removeReturne(Returne returne) {
		getReturnes().remove(returne);
		returne.setOrderform(null);

		return returne;
	}
	
	public List<Returnmore> getReturnmores() {
		return this.returnmores;
	}

	public void setReturnmores(List<Returnmore> returnmores) {
		this.returnmores = returnmores;
	}

	public Returnmore addReturnmore(Returnmore returnmore) {
		getReturnmores().add(returnmore);
		returnmore.setOrderform(this);

		return returnmore;
	}

	public Returnmore removeReturnmore(Returnmore returnmore) {
		getReturnmores().remove(returnmore);
		returnmore.setOrderform(null);

		return returnmore;
	}

}